NOTE: These are untested code samples provided for a conceptual understanding only. # Request / Response
<?php
$request = new HttpRequest();
$request->setUrl('https://apx.cisco.com/ccw/api/sbp/v1.0/subscription/usage');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'authorization' => 'Bearer uIQxCGrC6etCBY2ufYozpVU10hwE',
'content-type' => 'application/json'
));
$request->setBody('{
"uuid": "jhfsdjkhfsdkh3489434",
"createdBy": "user_id",
"createdDateTime": "2017-01-24T16:00:00-08:00",
"billingAddressId": 123456789,
"invoiceList": [
{
"invoiceNumber": 123
},
{
"invoiceNumber": 456
}
],
"beginDate": "2017-01-31",
"endDate": "2017-01-31",
"pageNumber": 1
}
');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}